
<div class="am-container ">
    <div class="dux-page">
        <div class="dux-cart" data-dux="cart-submit">

            <!--if{!empty($addInfo)}-->
            <div class="cart-title">确认收货地址</div>
            <ul class="add-list am-cf am-avg-sm-5">
                <!--loop{$addList as $vo}-->
                <li class="{$addInfo.add_id == $vo.add_id ? 'active' : ''}">
                    <a href="{url('', array_merge($urlParams, ['add_id' => $vo.add_id]))}">
                        <div class="title">
                            {$vo.name} {$vo.tel} 收

                        </div>
                        <div class="info">
                            {$vo.province} {$vo.city} {$vo.region}
                            <br>
                            {$vo.address} {$vo.zip}
                        </div>
                    </a>
                </li>

                <!--{/loop}-->

                <li>
                    <a href="{url('order/Address/index')}" target="_blank">
                        <div class="plus">
                            <i class="am-icon-plus"></i>
                            管理地址
                        </div>
                    </a>
                </li>
                <input name="add_id" type="hidden" value="{$addId}" >
            </ul>

            <!--{else}-->
            <div class="cart-title"> <i>1</i> 添加收货地址</div>
            <form class="add-info" action="{url('order/Address/add')}" method="post" data-dux="form-bind">
                <dl class="am-cf">
                    <dt>姓名</dt>
                    <dd><input class="am-form-field" name="name" placeholder="收件人姓名"></dd>
                </dl>
                <dl class="am-cf">
                    <dt>电话</dt>
                    <dd><input class="am-form-field" name="tel" placeholder="收件人电话"></dd>
                </dl>
                <dl class="am-cf">
                    <dt>地区</dt>
                    <dd id="distpicker">
                        <select class="am-form-field" name="province" data-province=""></select>
                        <select class="am-form-field" name="city" data-city=""></select>
                        <select class="am-form-field" name="region" data-region=""></select>
                    </dd>
                </dl>
                <dl class="am-cf">
                    <dt>地址</dt>
                    <dd>
                        <input class="am-form-field" name="address" placeholder="请填写街道门牌号码">
                    </dd>
                </dl>
                <dl class="am-cf">
                    <dt>邮编</dt>
                    <dd><input class="am-form-field" name="zip" placeholder="邮政编码"></dd>
                </dl>
                <dl class="am-cf">
                    <dt></dt>
                    <input type="hidden" name="default" value="1">
                    <input type="hidden" name="refresh" value="1">
                    <dd><button class="am-btn am-btn-danger" type="submit">保存地址</button></dd>
                </dl>
            </form>
            <!--{/if}-->

            <div class="cart-title"> <i>2</i> 确认付款方式</div>

            <div class="cart-box">
                <ul class="select-box am-cf">
                    <li class="{$urlParams.pay_type == 1 ? 'active' : ''}">
                        <a href="{url('', array_merge($urlParams, ['pay_type' => 1]))}">在线支付</a>
                    </li>
                    <li class="{$urlParams.pay_type == 2 ? 'active' : ''}">
                        <a href="{url('', array_merge($urlParams, ['pay_type' => 2]))}">货到付款</a>
                    </li>
                </ul>
                <input name="pay_type" type="hidden" value="{$payType}" >
            </div>


            <div class="cart-title"> <i>3</i> 确认配送方式</div>


            <div class="cart-box">
                <!--if{empty($addInfo)}-->
                请先添加收货地址
                <!--{/if}-->
                <!--loop{$deliveryList as $key => $vo}-->
                <label class="item">
                    <input type="radio" name="delivery" value="{$vo.label}" data-price="{$vo.total_price}"
                           data-name="{$vo.name}" {$key == 0 ? 'checked' : ''} >
                    {$vo.name}
                </label>
                <!--{/loop}-->
            </div>


            <div class="cart-title"> <i>4</i> 确认订单信息</div>

            <table class="am-table">
                <thead>
                <tr>
                    <th width="70">图片</th>
                    <th>商品</th>
                    <th class="am-text-center">单价</th>
                    <th class="am-text-center" width="110">数量</th>
                    <th class="am-text-center">小计</th>
                </tr>
                </thead>
                <tbody>
                <!--loop{$pageList as $key => $vo}-->
                <tr>
                    <td class="am-text-middle dux-page-goods">
                        <a href="{$vo.url}" target="_blank"><img src="{$vo.image}" alt="{$vo.name}" width="64"
                                                                 height="64"></a>
                    </td>
                    <td class="am-text-middle dux-page-goods">
                        <div class="title"><a href="{$vo.url}" target="_blank">{$vo.name}</a></div>
                        <!--if{!empty($vo.options)}-->
                        <div class="info">
                            <!--loop{$vo.options as $v}-->
                            {$v.value}
                            <!--{/loop}-->
                        </div>
                        <!--{/if}-->
                    </td>
                    <td class="am-text-center am-text-middle am-text-danger">
                        ￥{price_format($vo.price)}
                    </td>
                    <td class="am-text-center am-text-middle">
                        {$vo.qty}
                    </td>
                    <td class="am-text-center am-text-middle">
                        <div>￥<span>{price_format($vo.total)}</span></div>
                    </td>
                </tr>
                <!--{/loop}-->
                </tbody>
            </table>
            <div class="cart-info">
                共有<em>{$info.items}</em>件商品, 需要<span data-count-type>在线支付</span> <em data-count-price="{$info.total}" class="am-text-danger">{$info.total}</em>
                元 (含运费<span data-count-delivery>0</span>元)
                <a href="javascript:;" class="am-btn am-btn-danger" data-url='{url("submit")}' data-submit>提交订单</a>
            </div>
        </div>
    </div>
</div>

<div class="am-g am-g-fixed">

</div>

<!--#include file="common_footer.html"-->

<script>
    Do('distpicker', function () {
        $(function () {
            $('#distpicker').distpicker();
        });
    });
</script>